const storage={
    set(key,value){
        localStorage.setItem(key,JSON.stringify(value));
    },
    get(key){
        return JSON.parse(localStorage.getItem(key));
    },
    remove(key){
        localStorage.removeItem(key)
    },
    clear(){
        localStorage.clear()
    },
    sessionSet(key,value){
        sessionStorage.setItem(key,JSON.stringify(value));
    },
    sessionGet(key){
        return JSON.parse(sessionStorage.getItem(key));
    },
    sessionRemove(key){
        sessionStorage.removeItem(key)
    },
    sessionClear(){
        sessionStorage.clear()
    },
    sessionClearKeys(array){
        if(array){
         array.forEach(itemKey=>{
             sessionStorage.removeItem(itemKey)
         })
        }
    }

}
export default storage